Skip to content

fix(openclaw-plugin): sanitize memory_store input to prevent context pollution#1031

Closed
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/sanitize-memory-store-input
Closed

fix(openclaw-plugin): sanitize memory_store input to prevent context pollution#1031
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/sanitize-memory-store-input

Conversation

@mobilebarn
Copy link
Copy Markdown

Summary

  • Applies sanitizeUserTextForCapture to the memory_store tool's text input before sending it to OpenViking, preventing <relevant-memories> blocks and other injected metadata from polluting the memory extraction pipeline.
  • Returns an early rejection when the input is empty after sanitization (metadata-only content).
  • Uses the sanitized text length in log messages for accurate diagnostics.

Closes #898

Test plan

  • Call memory_store with text containing <relevant-memories>...</relevant-memories> blocks and verify they are stripped before storage
  • Call memory_store with text that is entirely metadata and verify the tool returns the "Nothing to store" rejection
  • Call memory_store with clean text and verify it stores normally without modification
  • Verify existing auto-capture path still works as before (no regression)

…pollution

Applies sanitizeUserTextForCapture to the memory_store tool's text input,
preventing <relevant-memories> blocks and metadata from polluting the
memory extraction pipeline.

Closes volcengine#898
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@mobilebarn
Copy link
Copy Markdown
Author

Closing — upstream PR #1040 (context engine refactor, merged 2026-03-28) and #1053 (defensive re-spawn) supersede these changes. The issues these PRs addressed are now resolved in main. Thank you to the OV team for the comprehensive refactor.

@mobilebarn mobilebarn closed this Mar 29, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OpenClaw plugin auto-capture may mis-capture <relevant-memories> injected context and intermittently fail with AbortError on OpenClaw v2026.3.13

1 participant